<%@ page language="java" contentType="text/html; charset=UTF-8"	pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<link rel="stylesheet" type="text/css" href="<%=basePath%>admin/css/global.css" />
		<link rel="stylesheet" type="text/css" href="<%=basePath%>admin/css/page.css" />
		<link rel="stylesheet" type="text/css" href="<%=basePath%>admin/css/form.css" />
		<link rel="stylesheet" type="text/css" href="<%=basePath%>admin/css/style.css" />
		<link rel="stylesheet" type="text/css"	href="<%=basePath%>admin/css/dialog.css" />
		<title></title>
	</head>
	<body>
   	<div class="wapper show">
		<h2 class="pagerTitle tabTitle" ><a class="tab tabActive">修改文章</a></h2>
		<form id="newsform" name="newsform" enctype="multipart/form-data" method="post" action="updateNews.action">
		<div class="inputLabelParent">
			<div class="inputLabel">
			<input type="hidden" name="newsId" id="id" value="${news.id}"/>
			<input type="hidden" name="catagoryId" id="catagoryId" value="${news.category.id}"/>
			<label class="left">文章标题:</label><input type="text" name="news.title" id="title" class="text" style="width:300px;" maxlength="50" value="${news.title}"><span class="tips" id="titleerror">* 必填，50字以内</span>
			</div>
			<div class="inputLabel heightauto">
			<label class="left">文章摘要:</label><textarea class="text" name="news.abstracts" id="abstracts" style="width: 300px">${news.abstracts}</textarea>
			</div>
			<div class="inputLabel">
			<label class="left">文章分类:</label>
				<select id="newsCategory" name="ncId"></select>
			</div>
			<div class="inputLabel" style="display:none;">
			<label class="left" id="indexPic">首页图片:</label>
			<s:if test="null != newsFile"><s:file id="pic" name="pic" cssStyle="display:none;" /><div id="picDiv"><a href="<%=basePath%>upload/news/${newsFile.saveName}" target="_blank"><s:property value="newsFile.name" /></a>&nbsp;<a class="deleteFile" id="${newsFile.id}" href="#">删除</a></div></s:if>
			<s:else><s:file id="pic" name="pic" /></s:else>
			</div>
			<div class="inputLabel">
			<label class="left">是否推荐:</label>
			<input type="radio" name="news.isRecommended" id="hot" value="0" <s:if test='news.isRecommended=="0"'>checked='checked'</s:if> /> <label style="width:20px;">否</label>
			<input type="radio" name="news.isRecommended" id="hot" value="1"  <s:if test='news.isRecommended=="1"'>checked='checked'</s:if>  /> <label style="width:20px;">是</label>
			</div>
			<div class="inputLabel">
			<label class="left">浏览数:</label><input type="text" name="news.readTimes" value="${news.readTimes}" id="readTimes" class="text" style="width:100px;"  maxlength="10" onKeyUp="value=value.replace(/[^\d]/g,'')" maxlength="10"    onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))">
			<!-- 
			<label class="left">支持数:</label><input type="text" name="suNum" class="text" style="width:50px;">
			<label class="left">反对数:</label><input type="text" name="deNum" class="text" style="width:50px;">
			 -->
			</div>
			<div class="inputLabel heightauto">
			<label class="left">文章内容: </label><textarea name="news.content">${news.content}</textarea>
			</div>
			
			<div style="clear:both; padding-left:500px;">
			<div class="submit submitFloat"><input type="button" id="updateNews" value="保存" />  <input type="button" id="returnNews" value="返回" /> 
			</div>
			</div>
		</div>
		</form>
		<input type="hidden" id="errorinfo" value="${errorinfo}" />
   	</div>
   
   
   		<script type="text/javascript" src="<%=basePath%>admin/js/jquery.js"></script>
		<script type="text/javascript" src="<%=basePath%>admin/js/jqueryui.js"></script>
		<script type="text/javascript" src="<%=basePath%>admin/js/simpleDialog.js"></script>
		<script type="text/javascript" src="<%=basePath%>admin/js/simplePage.js"></script>
		<script type="text/javascript" src="<%=basePath%>admin/news/js/checkForm.js"></script>
		<script type="text/javascript" src="<%=basePath%>admin/fckeditor/fckeditor.js"> </script> 
   		<script language="JavaScript" type="text/javascript" charset="utf-8"> 
    		window.onload = function() { 
    		var oFCKeditor = new FCKeditor( 'news.content' ) ; 
    		oFCKeditor.BasePath = '<%=basePath%>admin/fckeditor/';        
    		oFCKeditor.Height = 450 ;       
   			oFCKeditor.Width = 630 ;        
			oFCKeditor.ToolbarSet = 'Default';
			oFCKeditor.Config["CustomConfigurationsPath"]="<%=basePath%>admin/fckeditor/myconfig.js";
			oFCKeditor.ReplaceTextarea();
    }
	</script> 
   
  </body>
</html>
